package dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import model.MajorPlan;

public class MajorPlanDao {
public int addMajorPlan(Connection con,MajorPlan mp) throws Exception{
	String sql="insert into majorplan values (null,?,?,?,?,?,?)";
	PreparedStatement pstmt=con.prepareStatement(sql);
	pstmt.setString(1,mp.getName());
	pstmt.setString(2, mp.getPlanYear());
	pstmt.setString(3, mp.getStartDate());
	pstmt.setString(4, mp.getEndDate());
	pstmt.setString(5,mp.getMajorPlan());
	pstmt.setString(6,mp.getMajorid());
	return pstmt.executeUpdate();
}
}
